/*
 * Project CHEN Rendering Engine : /buffer.hpp
 * Created: 2021-03-03, Last modified:  2021-03-03
 * 
 * This file declares the memory buffer class used per thread when
 * rendering.
 * 
 * Copyright (C) 2021 Hineven (hineven@pku.edu.cn)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef _H_BUFFER
#define _H_BUFFER
#include "heads.hpp"
// #define baloc(type) new (arn.alloc(sizeof(type))) type
#define balloc(type) new (type)
#define bfree(pointer) delete (pointer)
namespace chen {

// The per thread memory buffer
// save time from constantly allocating small memory pices
// I have no idea how my cpu l1 cache aligns, so it was set
// to a big value.
class alignas(64) MemoryBuffer {
    // Currently useless
};

extern thread_local MemoryBuffer arn;

}
#endif